package com.example.watchfaceanimation;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        final View view = findViewById(R.id.mainlayout);
        final ViewGroup viewGroup = (ViewGroup) view;
        findViewById(R.id.imageButton).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                viewGroup.removeViewAt(1);
//                ImageView imageView = new ImageView(MainActivity.this);
//                imageView.setImageDrawable(ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_launcher_background));
//                viewGroup.addView(imageView);
//                RunTextView runTextView = new RunTextView(MainActivity.this);
//                viewGroup.addView(runTextView);
//                runTextView.runWithAnimation(100);
                viewGroup.addView(new NumberFlipView(MainActivity.this));
            }
        });
        Log.i(TAG, "onCreate: getResources().getDisplayMetrics()" + getResources().getDisplayMetrics());
    }
}
